package leetcode.tree;

import leetcode.tree.common.TreeNode;
import leetcode.tree.common.TreeUtils;

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution872 {
    public boolean leafSimilar(TreeNode root1, TreeNode root2) {
        return TreeUtils.leafSimilar(root1, root2);

    }
}

public class leetcode872 {
    public static void main(String[] args) {
        Solution872 solution872 = new Solution872();
        Integer[] root1 = {3, 5, 1, 6, 2, 9, 8, null, null, 7, 4};
        Integer[] root2 = {3,5,1,6,7,4,2,null,null,null,null,null,null,9,8};
        System.out.println(solution872.leafSimilar(TreeUtils.generateLeetcodeTree(root1), TreeUtils.generateLeetcodeTree(root2)));
    }
}
